<?php 
include '../data/data.php';
$user=$_SESSION['user']; //获取到的用户名
$pass=$_SESSION['pass']; //获取到的密码
$result= mysql_query("SELECT * FROM user WHERE username='$user' and password='$pass'", $link);  
$row = mysql_fetch_array($result);
if($row[id]==''){
	header('location:/user/login.html?fwd=/user/server.html');
}
?>
<html><head lang="en">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>客服中心 - <?php echo $rowx[name]; ?></title>
    <link rel="stylesheet" href="/public/styles/base.css">
    <link rel="stylesheet" href="/styles/pay_edit.css">
    <link rel="stylesheet" href="/layui/css/layui.css">
    <link rel="stylesheet" href="/css/new.css">
    <style>
        a{color: #0b0b0b!important;text-decoration:underline;font-size: 18px;color: red!important;}
        .layui-input-block {
             margin-left: 0!important;
            min-height: 36px;
        }
        .chosn{
            color:#5398FD!important;
            border:1px solid rgba(83,152,253,1)!important;
        }
    </style>
<link id="layuicss-layer" rel="stylesheet" href="/layui/css/modules/layer/default/layer.css?v=3.1.1" media="all"></head>
<body style="background-color:#ffffff">
<!--<header class="z_header block_bg">-->
<!--    <div class="toptil">-->
<!--        <a href="/user/index.html"><img src="/picture/icon_20.png" alt=""></a>-->
<!--        <p>客服返利</p>-->
<!--    </div>-->
<!--</header>-->
<!--div.container 总外框  start-->
<div class="nobn" style="padding: 15px 0 15px 15px;">
    <p style="font-size: 14px;color: #333;margin-bottom: 12px;">问题类型</p>
    <div class="" style="border:1px solid rgba(209,209,209,1);border-radius: 3px;color:#999999 ;font-size: 12px;display: inline-block;padding: 6px 20px;">申请返利
    </div>

    <div class="" style="margin: 0 10px;border:1px solid rgba(209,209,209,1);border-radius: 3px;color:#999999 ;font-size: 12px;display: inline-block;padding: 6px 20px;">游戏问题
    </div>

    <div class="chosn" style="border:1px solid rgba(209,209,209,1);border-radius: 3px;color:#999999 ;font-size: 12px;display: inline-block;padding: 6px 20px;">投诉和其他问题
    </div>
</div>
<div style="">
    <form class="layui-form" action="/index/sdkapi/feedbackAdd" method="post">
        <div style="width: 100%;height: 5px;background: #f4f4f4"></div>
        <div class="layui-form-item" style="margin-bottom: 0;height: 46px;line-height: 46px;">
            <div class="layui-input-block" style="font-size: 14px;color: #333333;padding-left: 16px;">
                输入标题<input style="width: 70%;display: inline-block;border: none;font-size: 12px;color: #999999;padding-left: 16px;" type="text" id="title" name="title" lay-verify="required" placeholder="请输入您的标题" autocomplete="off" class="layui-input" maxlength="15">
            </div>
        </div>
        <div style="width: 100%;height: 5px;background: #f4f4f4"></div>
        <div class="layui-form-item layui-form-text" style="padding: 16px;margin-bottom: 0;">
            <div style="font-size: 11px;color: #333333;margin-bottom: 12px;">
                <div style="float: left;">
                    <a style="text-decoration: none;font-size: 14px;" onclick="jump_qq(this)" data-id="<?php echo $rowx[kefu]; ?>" href="javascript:void(0);"><span style="color: #FF0000;">*</span><span style="color: #333">客服QQ:</span> <?php echo $rowx[kefu]; ?> </a>
                </div>
                <div style="float: left;">
                    <a style="text-decoration: none;font-size: 14px;" onclick="javascript:void (0);" data-id="<?php echo $rowx[qun]; ?>" href="javascript:void(0);"><span style="color: #333">、QQ群:</span> <?php echo $rowx[qun]; ?></a>
                </div>
                <div style="clear:both;"></div>
            </div>
            <div class="layui-input-block">
                <textarea id="reply" name="content" placeholder="请输入内容" class="layui-textarea layui-hide"></textarea><div class="layui-layedit"><div class="layui-unselect layui-layedit-tool"><i class="layui-icon layedit-tool-b" title="加粗" lay-command="Bold" layedit-event="b" "=""></i><i class="layui-icon layedit-tool-i" title="斜体" lay-command="italic" layedit-event="i" "=""></i><i class="layui-icon layedit-tool-u" title="下划线" lay-command="underline" layedit-event="u" "=""></i><i class="layui-icon layedit-tool-d" title="删除线" lay-command="strikeThrough" layedit-event="d" "=""></i><span class="layedit-tool-mid"></span><i class="layui-icon layedit-tool-left" title="左对齐" lay-command="justifyLeft" layedit-event="left" "=""></i><i class="layui-icon layedit-tool-center" title="居中对齐" lay-command="justifyCenter" layedit-event="center" "=""></i><i class="layui-icon layedit-tool-right" title="右对齐" lay-command="justifyRight" layedit-event="right" "=""></i><span class="layedit-tool-mid"></span><i class="layui-icon layedit-tool-link" title="插入链接" layedit-event="link" "=""></i><i class="layui-icon layedit-tool-unlink layui-disabled" title="清除链接" lay-command="unlink" layedit-event="unlink" "=""></i><i class="layui-icon layedit-tool-face" title="表情" layedit-event="face" "=""></i></div><div class="layui-layedit-iframe"><iframe id="LAY_layedit_1" name="LAY_layedit_1" textarea="reply" frameborder="0" style="height: 280px;"></iframe></div></div>
            </div>
            <p style="color: #333333;font-size: 14px;margin-top: 12px;">自助在线提交申请返利或游戏投诉其他问题</p>
        </div>
        <div style="width: 100%;height: 10px;background: #f4f4f4;margin-bottom: 45px;"></div>
        <div class="layui-form-item" style="position: fixed;bottom:0;right: 0;width: 50%;margin-bottom: 0;color: #fff;height: 45px;">
            <div class="layui-input-block" style="height: 45px;">
                <input type="hidden" id="user_id" name="user_id" value="76805">
                <button style="background-color: #5398FD!important;font-size: 16px;height: 45px;" id="btn" type="submit" class="layui-btn layui-btn-fluid" lay-submit="" lay-filter="formDemo">在线提交</button>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block" style="position: fixed;bottom:0;left: ;: 0;width: 50%;background: #FF7200;height: 45px;line-height: 45px;">
                <a style="text-decoration: none;text-align: center;color: #fff!important;" href="/user/user.html"><p style="text-align: center">返回中心</p></a>
            </div>
        </div>
    </form>
</div>
<!--div.container 总外框  end-->
<script src="/public/scripts/jquery-1.11.1.min.js"></script>
<script src="/public/scripts/jquery.mobile.min.js"></script>
<script src="/layui/layui.js"></script>
<script>
    layui.use(['layer', 'form','layedit'], function(){
        layedit = layui.layedit,form = layui.form;
        layedit.set({
            uploadImage: {
                url: '/user/upimg.php' //接口url
                ,type: '' //默认post
            }
        });
        var index =layedit.build('reply'); //建立编辑器
        form.on('submit(formDemo)', function(data){
            var value=layedit.getContent(index);
            if(value=='')return false;
        });
        $(".nobn>div").click(function (){
            var html='';
            var valu=$(".chosn").text();
            var value = valu.replace(/\s*/g,"");
            switch (value) {
                case '游戏问题':
                    html='游戏名字：<br/>' +
                        '游戏账号：<br/>' +
                        '密码：尽量有<br/>' +
                        '区服：<br/>' +
                        '角色名字：<br/>' +
                        '问题描述：<br/>' +
                        '----------------------------------<br/>'+
                        '请按以上格式，编辑填写好，然后提交';
                    break;
                case '申请返利':
                    html='游戏名字：<br/>' +
                        '游戏账号：<br/>' +
                        '区服：<br/>' +
                        '角色名字：<br/>' +
                        '角色ID:游戏内点击角色头像查看或游戏内点击设置查看<br/>' +
                        '充值金额：<br/>' +
                        '充值时间：<br/>' +
                        '备注：;<br/>'+
                        '----------------------------------<br/>'+
                        '1：返利以游戏内活动公告,或游戏介绍详情处为准<br/>'+
                        '2：请按以上格式,编辑填写好,然后提交<br/>'
                    break;
                case '其他问题':
                    html='';
                    break;
                default:
                    html='';
                    break;
            }
            // var value=layedit.getContent(index);
            layedit.setContent(index,html);
            // $('#content').html(html);
        });
        form.on('submit(formDemo)', function(data){
            // console.log(data.elem) //被执行事件的元素DOM对象，一般为button对象
            // console.log(data.form) //被执行提交的form对象，一般在存在form标签时才会返回
            // console.log(data.field) //当前容器的全部表单字段，名值对形式：{name: value}
            // console.log(data.field.content) //当前容器的全部表单字段，名值对形式：{name: value}
            var value=layedit.getContent(index);
            var ro=$(".chosn").text();
            var row = ro.replace(/\s*/g,"");
            if(value==''){
                layer.msg('内容不能为空');
                return false;
            }
            data.field.content=value;
            data.field.type=row;
            $.ajax({
                type: "POST", //提交方式
                url: "/user/upadd.php",//路径
                data: data.field,
                success: function (result) {//返回数据根据结果进行相应的处理
                    var result=JSON.parse(result);
                    if (result.code==200) {
                        alert(result.msg);
                        window.location.href='/user/feedbackList.html';
                    } else {
                        alert(result.msg);
                        //刷新验证码
                        // $("#tipMsg").text("删除数据失败");
                    }
                }
            });
            return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
        });
    });
    function IsPC() {
        var userAgentInfo = navigator.userAgent;
        var Agents = ["Android", "iPhone",
            "SymbianOS", "Windows Phone",
            "iPad", "iPod"];
        var flag = true;
        for (var v = 0; v < Agents.length; v++) {
            if (userAgentInfo.indexOf(Agents[v]) > 0) {
                flag = false;
                break;
            }
        }
        return flag;
    }
    function jump_qq(obj) {
        var qq = $(obj).attr('data-id');
        if (IsPC()) {
            window.open("http://wpa.qq.com/msgrd?v=3&uin=" + qq + "&site=qq&menu=yes");
        } else {
            window.open("mqqwpa://im/chat?chat_type=wpa&uin=" + qq + "&version=1&src_type=web&web_src=oicqzone.com");
        }
    }
    $(".nobn>div").click(function () {
        $(this).addClass("chosn").siblings().removeClass("chosn");
    })
</script>

</body></html>